<template>
    <div>
        <el-card>
            <!-- 头部表单 -->
            <el-form :inline="true"
                     :model="formInline"
                     class="demo-form-inline"
                     size="small"
                     ref="ruleForm"
                     v-show="showSearch">
                <el-form-item label="系统模块">
                    <el-input v-model="formInline.systemModule"
                              placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item label="请求方式">
                    <el-input v-model="formInline.requestMethod"
                              placeholder="请输入"></el-input>

                </el-form-item>
                <el-form-item label="操作人员">
                    <el-input v-model="formInline.operator"
                              placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button size="mini"
                               icon="el-icon-search"
                               type="primary"
                               @click="onSubmit">查询</el-button>
                    <el-button size="mini"
                               icon="el-icon-refresh"
                               @click="resize('ruleForm')">重置</el-button>
                </el-form-item>
            </el-form>
            <el-row :gutter="10"
                    class="mb8">
                <right-toolbar :showSearch.sync="showSearch"
                               @queryTable="getList"></right-toolbar>
            </el-row>

            <el-table :data="tableData"
                      height="calc(100vh - 300px)">
                <el-table-column prop="logCode"
                                 label="日志编号1"
                                 align="center">
                </el-table-column>
                <el-table-column prop="systemModule"
                                 label="系统模块"
                                 align="center">
                </el-table-column>
                <el-table-column prop="operationType"
                                 label="操作类型"
                                 align="center">
                </el-table-column>
                <el-table-column prop="requestMethod"
                                 label="请求方式"
                                 align="center">
                </el-table-column>
                <el-table-column prop="operator"
                                 label="操作人员"
                                 align="center">
                </el-table-column>
                <el-table-column prop="operationLocation"
                                 label="操作地点"
                                 align="center">
                </el-table-column>
                <el-table-column prop="operationStatus"
                                 label="操作状态"
                                 align="center">
                </el-table-column>
                <el-table-column prop="operationLog"
                                 label="操作日志"
                                 align="center">
                </el-table-column>
            </el-table>
            <pagination v-show="total > 0"
                        :total="total"
                        :page.sync="formInline.pageNum"
                        :limit.sync="formInline.pageSize"
                        @pagination="getList" />

        </el-card>
    </div>
</template>

<script>
    import { maintenance } from "@/api/monitor/operlog";
    export default {
        data () {
            return {
                // 总条数
                total: 10,
                // 显示搜索条件
                showSearch: true,
                tableData: [],
                formInline: {
                    pageNum: 1,
                    pageSize: 10,
                    storage: undefined,
                }
            }
        },
        methods: {
            getList () {
                maintenance(this.formInline).then(res => {
                    if (res) {
                        console.log(res)
                        this.tableData = res.rows;
                    }
                })
            },
            //查询
            onSubmit () {
                this.getList()
            },
            //重置
            resize () {
                this.formInline = {}
                this.getList()

            },

        },
        //初始化数据
        created () {
            this.getList();
        },
    }
</script>

<style lang="scss" scoped></style>